-
-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Prettier v3 #901
Support Prettier v3 #901
Conversation
🦋 Changeset detectedLatest commit: 6780f52 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
When this will be merged? |
For those wanting to experiment with this, I've published:
I was able to use the former as a drop-in replacement for the real |
It seems this PR can not be merged as-is? |
In the original PR, the logger was crashing. I didn't notice because I'd commented it out locally. I added an extra |
Line 32 in 1c0bdbf
But the prettier version in |
My project depends on As I mentioned in the issue description, upgrading the dependency makes the tests crash for an unknown reason:
Jest gives me nightmares but I can do some more digging if the error doesn't ring a bell. |
This fixes the testing issues for the PR to the upstream repo: prettier#901
@timdp @JounQin I've submitted a PR to Tim’s On a side note, it might be good to make |
@JounQin This change should now be ready for review 🙂 |
Any ideas when this will merged and released? |
@JounQin @danielwerg Bumping this. This issue makes the eslint-prettier plugin for VSCode useless with Prettier v3, so it's impacting productivity quite a bit. Is anything else blocking release? |
Please merge this |
Just wanted to ask... When will this be merged? |
Sorry for the delay, v16 has just been released! Before |
|
Prettier v3.0.0 was released this week. I tried to run prettier-eslint against it, and ran into:
The indentation happens merely in a logging statement, but commenting it out just propagates the unexpected input to another function. The underlying issue is that
prettier.format()
, called fromprettify()
, is now async. Hence, the mysteriousobject
is actually aPromise
.As a quick fix for that particular API change, it's sufficient to treat
prettify
as async and add anawait
. It's also called in two other places, but those are a return from an async function, so adding anawait
would be redundant. (I personally prefer to do it for clarity, but the linter rules won't let me.)This is only a fix for this particular incompatibility. It does not:
prettier
to v3.0.0: I tried, but then, the tests crash;However, it makes formatting work in my projects, and it's backwards compatible with v2, because you can safely
await
a string. Hence, it should at least be a step in the right direction.(Incidentally, only calling
indentString
if the logger is actually enabled would probably provide a nice performance boost.)